package com.cheng.dao.system;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.cheng.domain.system.Role;
import com.cheng.domain.system.User;

public interface RoleDao extends JpaRepository<Role, Integer> {

	@Query("from Role r inner join fetch r.users u where u.id = ?")
	List<Role> findByUserId(Integer id);

}
